# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-cloudpickle
pkgver=3.1.0
pkgrel=0
pkgdesc="Extended pickling support for Python objects"
url="https://pypi.org/project/cloudpickle/"
arch="noarch"
license="BSD-3-Clause"
makedepends="py3-flit-core py3-gpep517 py3-installer py3-wheel"
checkdepends="py3-pytest py3-psutil py3-tornado py3-typing-extensions py3-numpy"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/cloudpipe/cloudpickle/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/cloudpickle-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
1ab356d394af43496ab426c58a33e087dc2c71da77a7e744f860115a40217bac9f16d10b9510543415f8b8c1799729c6a6bf0f4c6b4b5eb82fce7a25fabbfa1d  py3-cloudpickle-3.1.0.tar.gz
"
